alias memoservx { 
  if !$dialog(memoservx) { /dialog -m memoservx memoservx }
  else { return }
}
dialog memoservx {
  title " ..:  - Memoserv :.."
  size -1 -1 280 142
  button "Memo Gnder", 1, 13 18 105 23,flat
  box "Memo Oku:", 2, 134 3 140 99,flat
  button "Memo 1", 31, 140 21 53 20,flat
  button "Memo 4", 34, 211 21 53 20,flat
  button "Memo 2", 32, 140 46 53 20,flat
  button "Dier", 6, 211 71 53 20,flat
  button "Memo 3", 33, 140 71 53 20,flat
  button "Son", 8, 211 46 53 20,flat
  button "Memo Sil", 9, 13 46 105 23,flat
  button "Tmn Sil", 11, 13 70 105 23,flat
  button "Memo List", 12, 12 104 105 23,flat
  box "", 13, 5 2 122 133
  button "Tamam", 14, 137 111 65 22,ok flat default
  button "ptal", 15, 208 111 65 22, cancel flat
}

on *:dialog:memoservx:init:*:{
  dll dll/mdx.dll SetMircVersion $version | dll dll/mdx.dll MarkDialog $dname
  dll dll/mdx.dll SetFont 1,2,31,31,34,32,6,33,8,9,11,12,13,14,15 12 700 Tahoma
  dll dll/mdx.dll SetFont  +b 1,2,31,31,34,32,6,33,8,9,11,12,13,14,15 700 Tahoma
}

on 1:dialog:memoservx:sclick:*:{
  if $did == 1 { if $dialog(memo1) == $null { dialog -ma memo1 memo1 } 
  }
  if $did == 8 { %msg memoserv read last }
  if $did isnum 31-34 { %msg memoserv read  $calc($did - 30) }
  if $did == 15 { halt }
  if $did == 12 {
  } 
  if $did == 12 { %msg memoserv list }
  if $did == 11 { %msg memoserv  del all  }
  if $did == 9 { If $dialog(memo2) == $null {
      %memo.t = Memo Sil
      %memo.b = Sil
      %memo.c = del
  dialog -ma memo2 memo2 } }
  if $did == 6 { If $dialog(memo2) == $null {
      %memo.t = Memo Oku
      %memo.b = Oku
      %memo.c = read
  dialog -ma memo2 memo2 } }
}
dialog memo1 {
  title "..: Memo Gnder :.."
  size 307 197 233 170
  button "Gnder", 1, 36 146 75 20, ok flat
  text "Nick:", 2, 15 7 26 13
  edit "", 3, 47 5 175 19, autohs
  text "Memo:", 4, 6 31 36 16, right
  edit "", 5, 48 29 174 99,  multi, return, vsbar
  box "", 8, 6 129 221 11
  button "Vazge", 9, 119 146 75 20,cancel flat
}
on 1:dialog:memo1:sclick:1:{
  if $did(3) == $null { %erromsg = Yanl Deneme | dialog -ma erro erro | halt }
  if $did(5) == $null { %erromsg = Yanl Deneme | dialog -ma erro erro | halt }
  var %tmp = 1
  var %tmp2 = $did(5).lines
  var %memo = ""
  while (%tmp <= %tmp2) {
    %memo = %memo $chr(32) $+ $did(5,%tmp)
    inc %tmp
  }
  %msg memoserv send $did(3) %memo 
  unset %memo.*
}
dialog memo2 {
  title ..: %memo.t :..
  size 307 197 175 74
  button %memo.b, 1, 13 48 68 20,ok flat
  text "Mesaj No:", 2, 22 9 87 13
  edit "", 3, 113 5 35 21, autohs
  box "", 8, 4 29 165 11
  button "Vazge", 9, 92 48 67 20,cancel flat
}
on 1:dialog:memo2:sclick:1:{
  if $did(3) == $null { %erromsg = Memo Bo Brakmayn | dialog -ma erro erro | halt }
  %msg memoserv %memo.c $did(3)
  unset %memo.*
}
dialog erro {
  title "..: Dikkat! Hata Olutu :.."
  size 238 164 220 90
  text %erromsg, 2, 60 19 145 18, center
  box "", 3, 12 46 196 10
  button "Tamam", 4, 72 62 75 22, ok flat
}
